home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue40 / Clinic / GridTestU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-09-29  |  846 b   |  45 lines

  1. unit GridTestU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   DBGrids, ScrollingDBGrid, Grids, ScrollingStringGrid, Db, DBTables;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Grid: TScrollingStringGrid;
  12.     DBGrid: TScrollingDBGrid;
  13.     Table1: TTable;
  14.     DataSource1: TDataSource;
  15.     procedure FormCreate(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. procedure TForm1.FormCreate(Sender: TObject);
  30. const
  31.   MaxX = 10;
  32.   MaxY = 50;
  33. var
  34.   Loop, Loop2: Integer;
  35. begin
  36.   Grid.ColCount := MaxX;
  37.   Grid.RowCount := MaxY;
  38.   for Loop := 0 to MaxY do
  39.     for Loop2 := 0 to MaxX do
  40.       Grid.Cells[Loop2, Loop] :=
  41.         Format('(%d,%d)', [Loop2, Loop])
  42. end;
  43.  
  44. end.
  45.